home *** CD-ROM | disk | FTP | other *** search
/ Champak 29 / Volume 29 - JOGO DISK .iso / Games / jungle_adventure.swf / scripts / __Packages / SSInterface.as < prev    next >
Text File  |  2006-11-29  |  2KB  |  96 lines

  1. class SSInterface extends MovieClip
  2. {
  3.    static var watchList = [];
  4.    function SSInterface()
  5.    {
  6.       super();
  7.       SSInterface.register(this);
  8.       this.stop();
  9.    }
  10.    function onUnload()
  11.    {
  12.       SSInterface.unregister(this);
  13.    }
  14.    function show(frame, noPause)
  15.    {
  16.       if(!noPause)
  17.       {
  18.          SSInterface.currentGame.pause();
  19.       }
  20.       this.btnCover.onRelease = function()
  21.       {
  22.       };
  23.       this.btnCover.useHandCursor = false;
  24.       this.gotoAndStop(frame);
  25.    }
  26.    static function hide()
  27.    {
  28.       SSInterface.target.resume();
  29.    }
  30.    static function showScreen(screen, noPause)
  31.    {
  32.       SSInterface.target.show(screen,noPause);
  33.    }
  34.    function resume()
  35.    {
  36.       SSInterface.currentGame.resume();
  37.       this.gotoAndStop(1);
  38.    }
  39.    static function register(mc)
  40.    {
  41.       SSInterface.target = mc;
  42.    }
  43.    static function unregister(mc)
  44.    {
  45.       SSInterface.target = null;
  46.    }
  47.    static function registerGame(game)
  48.    {
  49.    }
  50.    static function unwatchObject()
  51.    {
  52.       if(!SSInterface.currentObject)
  53.       {
  54.          return undefined;
  55.       }
  56.       var _loc2_ = undefined;
  57.       var _loc1_ = _loc2_ = SSInterface.watchList.length;
  58.       while((_loc1_ = _loc1_ - 1) > -1)
  59.       {
  60.          _loc2_[_loc1_].t.unwatch(_loc2_[_loc1_].n);
  61.       }
  62.       SSInterface.currentObject = null;
  63.    }
  64.    static function watchObject(obj, initMethod)
  65.    {
  66.       SSInterface.currentGame = obj.control.world.engine;
  67.       SSInterface.unwatchObject();
  68.       initMethod.apply(SSInterface,arguments);
  69.       SSInterface.currentObject = obj;
  70.    }
  71.    static function watchProp(obj, prop, method)
  72.    {
  73.       obj.watch(prop,method);
  74.       SSInterface.watchList.push({n:prop,t:obj});
  75.       method(prop,obj[prop],obj[prop]);
  76.    }
  77.    static function textValue(prop, oldValue, newValue)
  78.    {
  79.       SSInterface.target[prop] = newValue;
  80.       return newValue;
  81.    }
  82.    static function meterValue(prop, oldValue, newValue)
  83.    {
  84.       SSInterface.target[prop].setValue(newValue);
  85.       return newValue;
  86.    }
  87.    static function invertedMeterValue(prop, oldValue, newValue)
  88.    {
  89.       SSInterface.target[prop].value = 1 - newValue;
  90.       return newValue;
  91.    }
  92.    static function unwatchProp()
  93.    {
  94.    }
  95. }
  96.